package com.dragon.repository.mapper;

import com.dragon.repository.entity.Warehouse;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 * 仓库表 Mapper 接口
 * </p>
 *
 * @author sy
 * @since 2023-11-13
 */
@Mapper
public interface WarehouseMapper extends BaseMapper<Warehouse> {

    /**
     * 根据id获取仓库名称
     * @param id
     * @return
     */
    @Select("SELECT a.`name` FROM dragon_warehouse a WHERE a.id = #{id}")
    String getWarehouseNameById(Integer id);

}
